<text> is the text that will be written as resource in the file.
<res type> is a four chars string, case sensitive, giving the resource type.
<res ID> is an integer. If not supplied, any free ID will be used.
<res name> defines the name of the created resource.
<fileName> is the pathname of the destination file. Default is current resource file.
<#nb> allows to give the entry number for a STR# resource (ex : "#1"). Using "#0" allows to deal with the last entry of the resource. Ignored for all other resource types.
<sep.char> is useful only with STR# ot STR resource creation, and allows to define the entries separator. Automatically recognized as default.
<replace> is a boolean, making all previous resource(s) with same name or ID to be replaced by the new one. Default is false. If <#nb> is used, then this param allows to switch between insertion (false, default) and replacement (true) of the designed STR# item.
"hex" allows to input an hexadecimal string rather that ASCII. (Format : "XX XX XX…", as returned by ResText XFCN).
"f=<flag(s)>" allows to set resources flag bits, where <flag(s)> can contain the following chars in any order:
C (changed), R (pReload), P (Protected), L (Locked), U (pUrgeable)
and S (Sustem heap).
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
The XCMD writes the new resource to choosen file, and returns <ID[,name]> of the new resource in the result.
If no ID is supplied, then any free one will be used.
If the supplied file name doesn't exist, it is created by the XCMD.
Unless "hex" is used, all control chars representations "[0]"…"[255]" will be replaced in the input string by their corresponding chars (as returned by ResText XFCN).
Two special cases must be considered:
STR: these resources may have both text (limited to 255 chars) & datas (unlimited size). Input can be a two lines string (or other kind of item, depending on <sep. char> parameter), being respectively the text and the datas to write in the resource.
STR#: these resources may have up to 32767 entries (each limited to 255 chars). Input can be a N lines string (or other kind of item, depending on <sep. char> parameter). Using <#nb> parameter, you can only change a given entry in the resource without needing to completely re-define it, or even insert a new one. Using "#0" allows to either replace the last entry (<replace> = true) or add a new entry at the end of the resource (<replace> = false).
Hint:
For STR & STR# creation, if you need to put the same char as current <sep. char> in the resource and don't use "hex" input, simply use "[<ASCII value>]" (ex: "[13]" for return or "[44]" for comma).
ERRORS
If an error occurs, the Result can return :
"Error : Not a file"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Volume is full"
"Error : Volume is locked"
"Error : Duplicate file/folder name"
"Error : AppleShare insufficient privileges"
"Error : No more disk space"
"Error : Duplicate resource ID" (only if Replace = FALSE)
"Error : Duplicate resource name" (only if Replace = FALSE)
"Error : Bad hex string"
"Error : Missing or empty parameter(s)"
"Error : Bad resource type"
"Error : Incorrect STR# item number"
"Error : Out of memory"
"Error : Couldn't create or change resource"
"Error : Incorrect flag char"
HISTORY
2.3 07/15/94
• Fixed a bug arising in 24 bits memory mode.
2.2 03/25/94
• Added "f=<flag(s)>" parameter
2.1 02/07/94
• Replacement of <ASCII value> by control chars 15 times faster!
Free for non-commercial use. Use in commercial software subjected to prior acknowledgement and licensing from the author, reachable at the following network addresses: